package com.anysoft.util;

import com.anysoft.formula.DataProvider;

/**
 * 将DataProvider包装为Properties
 * 
 * @author yyduan
 * @since 1.6.6.13
 *
 * @version 1.6.14.1 [20210310 duanyy] <br>
 * - Properties更改为接口，改从Properties.Abstract继承 <br>
 */
public class DataProviderProperties extends Properties.Abstract {

	/**
	 * DataProvider
	 */
	protected DataProvider provider = null;
	
	public DataProviderProperties(DataProvider p){
		provider = p;
	}
	
	@Override
	protected void _SetValue(String _name, String _value) {
		// noting to do
	}

	@Override
	protected String _GetValue(String _name) {
		String found = null;
		
		if (provider != null){
			Object context = provider.getContext(_name);			
			found = provider.getValue(_name, context, null);
		}
		
		return found;
	}

	@Override
	public void Clear() {
		// nothing to do
	}

}
